----------------------------------------------------------------------------------------------------------------------------------
--[[


]]--
----------------------------------------------------------------------------------------------------------------------------------
local hutao_com_cosmic_hat_sys_for_player = Class(function(self, inst)
    self.inst = inst

    self.classified = nil

    self.hat = nil
    self.linked_drying_rack = nil

end)
------------------------------------------------------------------------------------------------------------------------------
--- classified
    function hutao_com_cosmic_hat_sys_for_player:AttachClassified(classified)
        self.classified = classified
        classified:ListenForEvent("cosmic_hat_sys_com_update",function()
            self:net_updated()
            self.inst:PushEvent("hutao_com_cosmic_hat_sys_for_player_update")
        end)
        self:net_updated()
        print("hutao_com_cosmic_hat_sys_for_player:AttachClassified")
    end
------------------------------------------------------------------------------------------------------------------------------
--- update
    function hutao_com_cosmic_hat_sys_for_player:net_updated()
        self.hat = self:GetHat()
        self.linked_drying_rack = self:GetDryingRack()
    end
------------------------------------------------------------------------------------------------------------------------------
--- 帽子、晾晒
    ---- 
    function hutao_com_cosmic_hat_sys_for_player:SetHat(hat)
        if self.classified then
            self.classified:SetCosmicHatInst(hat)
        end
    end
    function hutao_com_cosmic_hat_sys_for_player:GetHat()
        if self.classified then
            local hat = self.classified:GetCosmicHatInst()
            if hat and hat:IsValid() then
                return hat
            end
        end
        return nil
    end
    ----- 
    function hutao_com_cosmic_hat_sys_for_player:SetDryingRack(drying_rack)
        if self.classified then
            self.classified:SetCosmicHatDryingRackInst(drying_rack)
        end
    end
    function hutao_com_cosmic_hat_sys_for_player:GetDryingRack()
        if self.classified then
            local drying_rack = self.classified:GetCosmicHatDryingRackInst()
            if drying_rack and drying_rack:IsValid() then
                return drying_rack
            end
        end
        return nil
    end
------------------------------------------------------------------------------------------------------------------------------
--- 
    function hutao_com_cosmic_hat_sys_for_player:HasHatInThisWorld()
        if self:GetHat() or self:GetDryingRack() then
            return true
        end
    end
------------------------------------------------------------------------------------------------------------------------------
---
------------------------------------------------------------------------------------------------------------------------------
return hutao_com_cosmic_hat_sys_for_player







